//管理用户数据相关
import {defineStore} from "pinia";
import {ref} from "vue";
import {listItemByBusinessIdAPI} from "@/api/Item";

export const useItemStore=defineStore('item',()=>{
    const itemList=ref({})
    const getItemList = async (businessId) => {
        const res=await listItemByBusinessIdAPI(businessId)
        itemList.value=res
        return res;
    }

    //3. 以对象的格式把state和action return
    return{
        itemList,
        getItemList
    }
},{
    persist:true
})
